function GetAnalyze_Application1() {
	var myData =[
		{
			application:'应用系统1(<a href=# onclick=javascript:GetLinkApplicationTP(1);><font color="blue"><u>应用拓扑展示</u></font></a>)',interface:'',type:'',sq:'',zx:'',apply:'',sip:'',protocol:'',dip:'',dport:'',onlinetime:'',offlinetime:'',hits:'',manager:'',action:'',diff:'',iconCls:'blank',expanded: true,children:[
				{application:'防火墙1',interface:'',type:'',sq:'',zx:'',apply:'',sip:'',protocol:'',dip:'',dport:'',onlinetime:'',offlinetime:'',hits:'',manager:'',action:'',iconCls:'blank',expanded: true,children:[
					{application:'策略1',interface:'inside',type:'GigabitEthernet0/0<br>GigabitEthernet0/1',sq:'审核通过',zx:'已生效',apply:'<a href=# onclick=javascript:SetACLApply1(3);><font color="blue"><u>申请单</u></font></a>',sip:'192.168.1.1',protocol:'tcp',dip:'192.168.2.1',dport:'inside',onlinetime:'2010-12-12 10:00:00',offlinetime:'2010-12-12 18:00:00',hits:'3',manager:'admin',action:'允许',diff:'符合基准',iconCls:'blank'},
					{application:'策略2',interface:'inside',type:'GigabitEthernet0/0<br>GigabitEthernet0/1',sq:'审核通过',zx:'已发布',apply:'历史记录',sip:'192.168.1.2',protocol:'tcp',dip:'192.168.2.1',dport:'outside',onlinetime:'',offlinetime:'',hits:'3',manager:'admin',action:'拒绝',diff:'缺失基准',iconCls:'blank'}
				]},
				{application:'防火墙2',interface:'',type:'',sq:'',zx:'',apply:'',sip:'',protocol:'',dip:'',dport:'',onlinetime:'',offlinetime:'',hits:'',manager:'',action:'',iconCls:'blank',expanded: true,children:[
					{application:'策略3',interface:'outside',type:'GigabitEthernet0/2<br>GigabitEthernet0/3',sq:'审核通过',zx:'已生效',apply:'<a href=# onclick=javascript:SetACLApply1(3);><font color="blue"><u>申请单</u></font></a>',sip:'192.168.1.1',protocol:'tcp',dip:'192.168.2.1',dport:'inside',onlinetime:'2010-12-12 10:00:00',offlinetime:'2010-12-12 18:00:00',hits:'3',manager:'admin',action:'允许',diff:'符合基准',iconCls:'blank'},
					{application:'策略4',interface:'outside',type:'GigabitEthernet0/2<br>GigabitEthernet0/3',sq:'审核通过',zx:'已生效',apply:'<a href=# onclick=javascript:SetACLApply1(3);><font color="blue"><u>申请单</u></font></a>',sip:'192.168.1.2',protocol:'tcp',dip:'192.168.2.1',dport:'outside',onlinetime:'2010-12-12 10:00:00',offlinetime:'2010-12-12 18:00:00',hits:'3',manager:'admin',action:'拒绝',diff:'缺失基准',iconCls:'blank'}
				]}
			]
		},{
			application:'应用系统2(<a href=# onclick=javascript:GetLinkApplicationTP(2);><font color="blue"><u>应用拓扑展示</u></font></a>)',interface:'',type:'',sq:'',zx:'',apply:'',sip:'',protocol:'',dip:'',dport:'',onlinetime:'',offlinetime:'',hits:'',manager:'',action:'',diff:'',iconCls:'blank',expanded: true,children:[
				{application:'防火墙3',interface:'',type:'',sq:'',zx:'',apply:'',sip:'',protocol:'',dip:'',dport:'',onlinetime:'',offlinetime:'',hits:'',manager:'',action:'',diff:'',iconCls:'blank',expanded: true,children:[
					{application:'策略1',interface:'inside',type:'GigabitEthernet0/0<br>GigabitEthernet0/1',sq:'审核通过',zx:'已发布',apply:'历史记录',sip:'192.168.1.1',protocol:'tcp',dip:'192.168.2.1',dport:'inside',onlinetime:'',offlinetime:'',hits:'3',manager:'admin',action:'拒绝',diff:'缺失基准',iconCls:'blank'},
					{application:'策略2',interface:'DMZ',type:'GigabitEthernet0/4',sq:'审核通过',zx:'已生效',apply:'<a href=# onclick=javascript:SetACLApply1(3);><font color="blue"><u>申请单</u></font></a>',sip:'192.168.1.2',protocol:'tcp',dip:'192.168.2.1',dport:'outside',onlinetime:'2010-12-12 10:00:00',offlinetime:'2010-12-12 18:00:00',hits:'3',manager:'admin',action:'允许',diff:'不符基准',iconCls:'blank'}
				]}
			]
		},{
			application:'应用系统3(<a href=# onclick=javascript:GetLinkApplicationTP(3);><font color="blue"><u>应用拓扑展示</u></font></a>)',interface:'',type:'',sq:'',zx:'',apply:'',sip:'',protocol:'',dip:'',dport:'',onlinetime:'',offlinetime:'',hits:'',manager:'',action:'',diff:'',iconCls:'blank',expanded: true,children:[
				{application:'防火墙4',interface:'',sq:'',zx:'',apply:'',sip:'',protocol:'',dip:'',dport:'',onlinetime:'',offlinetime:'',hits:'',manager:'',action:'',diff:'',iconCls:'blank',expanded: true,children:[
					{application:'策略1',interface:'outside',type:'GigabitEthernet0/2<br>GigabitEthernet0/3',sq:'审核通过',zx:'已生效',apply:'<a href=# onclick=javascript:SetACLApply1(3);><font color="blue"><u>申请单</u></font></a>',sip:'192.168.1.1',protocol:'tcp',dip:'192.168.2.1',dport:'outside',onlinetime:'2010-12-12 10:00:00',offlinetime:'2010-12-12 18:00:00',hits:'3',manager:'admin',action:'允许',diff:'缺失基准',iconCls:'blank'},
					{application:'策略2',interface:'DMZ',type:'GigabitEthernet0/4',sq:'审核通过',zx:'已生效',apply:'<a href=# onclick=javascript:SetACLApply1(3);><font color="blue"><u>申请单</u></font></a>',sip:'192.168.1.2',protocol:'tcp',dip:'192.168.2.1',dport:'ethernet0/1',onlinetime:'2010-12-12 10:00:00',offlinetime:'2010-12-12 18:00:00',hits:'3',manager:'admin',action:'允许',diff:'不符基准',iconCls:'blank'}
				]},
				{application:'防火墙5',interface:'',type:'',sq:'',zx:'',apply:'',sip:'',protocol:'',dip:'',dport:'',onlinetime:'',offlinetime:'',hits:'',manager:'',action:'',diff:'',iconCls:'blank',expanded: true,children:[
					{application:'策略3',interface:'inside',type:'GigabitEthernet0/0<br>GigabitEthernet0/1',sq:'审核通过',zx:'已发布',apply:'历史记录',sip:'192.168.1.1',protocol:'tcp',dip:'192.168.2.1',dport:'inside',onlinetime:'',offlinetime:'',hits:'3',manager:'admin',action:'允许',diff:'不符基准',iconCls:'blank'},
					{application:'策略4',interface:'outside',type:'GigabitEthernet0/2<br>GigabitEthernet0/3',sq:'审核通过',zx:'已发布',apply:'历史记录',sip:'192.168.1.2',protocol:'tcp',dip:'192.168.2.1',dport:'ethernet0/1',onlinetime:'',offlinetime:'',hits:'3',manager:'admin',action:'拒绝',diff:'符合基准',iconCls:'blank'}
				]}
			]
		}
    ]

    
	var states2 = [
		['1', '开发部'],
		['2', '采购部'],
		['3', '财务部'],
		['4', '人事部'],
		['5', '销售部']
		];
			
    var tree = new Ext.ux.tree.TreeGrid({
        dropConfig: {appendOnly:false},
        autoScroll:true,
        columns:[{
							header : '名称',
							width : 200,
							sortable : true,
							dataIndex : 'application'
						}, {
							header : '区域',
							width : 50,
							sortable : true,
							dataIndex : 'interface'
						}, {
							header : '接口',
							width : 100,
							sortable : true,
							dataIndex : 'type'
						}, {
							header : '源地址',
							width : 70,
							sortable : true,
							dataIndex : 'sip'
						}, {
							header : '协议',
							width : 70,
							sortable : true,
							dataIndex : 'protocol'
						}, {
							header : '目的地址',
							width : 70,
							sortable : true,
							dataIndex : 'dip'
						}, {
							header : '目的端口',
							width : 70,
							sortable : true,
							dataIndex : 'dport'
						}, {
							header : '上线时间',
							width : 120,
							sortable : true,
							dataIndex : 'onlinetime'
						}, {
							header : '下线时间',
							width : 120,
							sortable : true,
							dataIndex : 'offlinetime'
						}, {
							header : '命中次数',
							width : 70,
							sortable : true,
							dataIndex : 'hits'
						}, {
							header : '负责人',
							width : 60,
							sortable : true,
							dataIndex : 'manager'
						}, {
							header : '动作',
							width : 70,
							sortable : true,
							dataIndex : 'action'
						}, {
							header : '对比结果',
							width : 70,
							sortable : true,
							dataIndex : 'diff'
						}],
        tbar : [{
							text : '添加',
							tooltip : '添加',
							iconCls : 'add',
							handler : function() {
								SetACLApply_app();
							}
						}, '-', {
							text : '编辑',
							tooltip : '编辑',
							iconCls : 'modify',
							ref : '../modifyBtn',
							id:'modifyBtn',
							name:'modifyBtn',
							handler : function() {
								SetACLApply_app();
							}
						}, '-', {
							text : '删除',
							tooltip : '删除',
							iconCls : 'delete',
							ref : '../removeBtn',
							disabled : true,
							handler : function() {
								var s = grid.getSelectionModel().getSelections();
								for (var i = 0; r = s[i]; i++) {
									store.remove(r);
								}
							}
						}, '-', {
							text : '基准对比刷新',
							tooltip : '基准对比刷新',
							iconCls : 'refresh',
							handler : function() {
							}
						}
        ]
    });
    
	  tree.on("nodedragover", function(e){         
	  	       
	  	return false;     
	  }); 
	  
   	var root = new Ext.tree.TreeNode({
        text: '根节点',
        draggable : false,
        expanded: true
    });
 		tree.setRootNode(root);
 
  	var nodes = {}; 
  	nodes.children = myData;
	 	function appendChild(node, o){
	  	if (o.children != null && o.children.length > 0) {
	   		for (var a = 0; a < o.children.length; a++) {
	   			
				    /*var n = new Ext.tree.TreeNode({
				     task:o.children[a].task,
				     duration:o.children[a].duration,
				     user:o.children[a].user,
				     iconCls:o.children[a].iconCls,
				     checked:false,
				     leaf:false
				    });
				    node.appendChild(n);
				    appendChild(n, o.children[a]);*/
	  			
				    var n = new Ext.tree.TreeNode({
				     application:o.children[a].application,
				     interface:o.children[a].interface,
				     type:o.children[a].type,
				     apply:o.children[a].apply,
				     sq:o.children[a].sq,
				     zx:o.children[a].zx,
				     sip:o.children[a].sip,
				     protocol:o.children[a].protocol,
				     dip:o.children[a].dip,
				     dport:o.children[a].dport,
				     onlinetime:o.children[a].onlinetime,
				     offlinetime:o.children[a].offlinetime,
				     hits:o.children[a].hits,
				     manager:o.children[a].manager,
				     action:o.children[a].action,
				     diff:o.children[a].diff,
				     iconCls:o.children[a].iconCls,
				     expanded:o.children[a].expanded
				    });
				    node.appendChild(n);
				    appendChild(n, o.children[a]);
	  		
	  			
	   		}
	  	}
	 	}
	 	appendChild(root, nodes);    
    
 	function renderTopic1(value, p, record){
				if(value == '历史记录'){
					return String.format("{0}",value);
				}else{
					return String.format("<a href='javascript:void(null)' onclick='javascript:SetACLApply1();'>{0}</a>",value);
				}
    }	   
	
	return tree;	

}

function GetLinkApplication(){

	var myData = [
			['1', '系统1', "oa系统", "192.168.0.1"],
			['2', '系统2', "erp系统", "192.168.0.2"],
			['3', '系统3', "mysql数据库", "192.168.0.3"],
			['4', '系统4', "邮件系统", "子网1"],
			['5', '系统5', "oa系统", "子网2"]

	];


	var store = new Ext.data.ArrayStore({
				fields : [{
							name : 'id'
						}, {
							name : 'name'
						}, {
							name : 'depict'
						}, {
							name : 'addr'
						}]
			});

			
	store.loadData(myData);
	
	var sm = new Ext.grid.CheckboxSelectionModel();
	var grid = new Ext.grid.GridPanel({
				store : store,
				columns : [sm, {
							id : 'id',
							header : 'id',
							width : 10,
							sortable : true,
							dataIndex : 'id',
							hidden : true
						}, {
							header : '名称',
							width : 70,
							sortable : true,
							dataIndex : 'name'
						}, {
							header : '描述',
							width : 70,
							sortable : true,
							dataIndex : 'depict'
						}, {
							header : '地址',
							width : 150,
							sortable : true,
							dataIndex : 'addr'
						}],
				sm : sm,

			
				stripeRows : true,
				autoExpandColumn : 'id',
				stateful : true,
				region : 'center',
				stateId : 'devicesgrid1'
			});


	var WeekTimeWindows = new Ext.Window({
				layout : 'border',
				width : 800,
				height : 300,
				title : "应用系统",
				modal : true,
				resizable : true,
				maximizable : true,
				iconCls : 'server',
				items : [grid],
				plain : true
				
			});
	WeekTimeWindows.addButton({
				text : "确定",
				handler : function() {
					
					WeekTimeWindows.close();
				}
			});
	WeekTimeWindows.addButton({
				text : '取 消',
				handler : function() {
					WeekTimeWindows.close();
				}
			});
	WeekTimeWindows.show();
}


function GetLinkApplicationTP(types){

var panel;
if(types == 1){
panel = new Ext.Panel({
				frame : true,
				layout : 'form',
				region : 'center',
				bodyStyle: "background-color:#ffffff", 
				tbar : [{
							text : '刷新',
							tooltip : '刷新',
							iconCls : 'refresh',
							handler : function() {	
								document.frames('nettopo').location.reload()	
							}
						}],
				html: "<iframe src='nettopo1.html'  id='nettopo' name='nettopo' height=100% width=100% frameborder=no border=0 marginwidth=0 marginheight=0  allowtransparency=yes></iframe>"

			})
}else if(types == 2){
panel = new Ext.Panel({
				frame : true,
				layout : 'form',
				region : 'center',
				bodyStyle: "background-color:#ffffff", 
				tbar : [{
							text : '刷新',
							tooltip : '刷新',
							iconCls : 'refresh',
							handler : function() {	
								document.frames('nettopo').location.reload()	
							}
						}],
				html: "<iframe src='nettopo2.html'  id='nettopo' name='nettopo' height=100% width=100% frameborder=no border=0 marginwidth=0 marginheight=0  allowtransparency=yes></iframe>"

			})
}else if(types == 3){
panel = new Ext.Panel({
				frame : true,
				layout : 'form',
				region : 'center',
				bodyStyle: "background-color:#ffffff", 
				tbar : [{
							text : '刷新',
							tooltip : '刷新',
							iconCls : 'refresh',
							handler : function() {	
								document.frames('nettopo').location.reload()	
							}
						}],
				html: "<iframe src='nettopo3.html'  id='nettopo' name='nettopo' height=100% width=100% frameborder=no border=0 marginwidth=0 marginheight=0  allowtransparency=yes></iframe>"

			})
}else{
panel = new Ext.Panel({
				frame : true,
				layout : 'form',
				region : 'center',
				bodyStyle: "background-color:#ffffff", 
				tbar : [{
							text : '刷新',
							tooltip : '刷新',
							iconCls : 'refresh',
							handler : function() {	
								document.frames('nettopo').location.reload()	
							}
						}],
				html: "<iframe src='nettopo.html'  id='nettopo' name='nettopo' height=100% width=100% frameborder=no border=0 marginwidth=0 marginheight=0  allowtransparency=yes></iframe>"

			})
}

	var WeekTimeWindows = new Ext.Window({
				layout : 'border',
				width : 800,
				height : 630,
				title : "应用拓扑展示",
				modal : true,
				resizable : true,
				maximizable : true,
				iconCls : 'server',
				items : [panel],
				plain : true
				
			});
	WeekTimeWindows.addButton({
				text : "确定",
				handler : function() {
					
					WeekTimeWindows.close();
				}
			});
	WeekTimeWindows.addButton({
				text : '取 消',
				handler : function() {
					WeekTimeWindows.close();
				}
			});
	WeekTimeWindows.show();
}


function SetACLApply_app(setReturn){

	var states = [
		['1', '添加规则'],
		['2', '修改规则'],
		['3', '删除规则']
		];
	var states2 = [
		['1', 'ALL'],
		['2', 'TCP'],
		['3', 'UDP']
		];
	var states3 = [
		['1', 'ALL'],
		['2', 'IN'],
		['3', 'OUT']
		];
	var states4 = [
		['1', '禁止'],
		['2', '放行']
		];	
	var states5 = [
		['1', '无'],
		['2', '设备1'],
		['3', '设备2'],
		['4', '设备3']
		];	

	var set_center = {
		xtype: 'fieldset',
		margins:'5 5 5 5',
		layout : 'form',
		region:'center',
		bodyStyle : 'padding:10px;',
		items: [
						{
									xtype: 'checkbox',
									name: 'status',
									id  : 'status',
									fieldLabel: '是否启用',
									anchor: '100%'
						},{
								xtype : 'textfield',
								fieldLabel : '名称',
								id : 'name',
								name : 'name',
								anchor : '100%'
						},{
								xtype : 'textarea',
								fieldLabel : '描述',
								id : 'desc',
								name : 'desc',
								anchor : '100%'
						},{
								fieldLabel: '申请单类型',
								xtype : 'combo',
								name : 'time',
								frame : true,
								id : 'time',
								store : new Ext.data.ArrayStore({
										fields : ['abbr', 'state'],
										data : states
									}),
								valueField : 'abbr',
								displayField : 'state',
								typeAhead : true,
								mode : 'local',
								triggerAction : 'all',
								value : '1',
								editable : false,
								anchor: '100%'
						},new Ext.form.CompositeField({ 
							    fieldLabel: '选择应用系统', 
							    items: [ 
							    		
							        new Ext.form.TextField({ 
										    name: 'my_field',
										    value:'',
										    flex: 1 
										  }),{ 
													xtype:"button", 
													text:"...", 
													handler:function() 
													{ 
															GetLinkApplication();
													}
											}
							         
							    ] 
						}),new Ext.form.CompositeField({ 
							    fieldLabel: '选择设备', 
							    items: [ 
							    		
							        new Ext.form.TextField({ 
										    name: 'my_field',
										    value:'',
										    flex: 1 
										  }),{ 
													xtype:"button", 
													text:"...", 
													handler:function() 
													{ 
															GetLinkDevice();
													}
											}
							         
							    ] 
						}),{
								xtype : 'textfield',
								fieldLabel : '源IP',
								id : 'srcip1',
								name : 'srcip1',
								anchor : '100%'
						},{
								xtype : 'textfield',
								fieldLabel : '掩码',
								id : 'srcmask1',
								name : 'srcmask1',
								anchor : '100%'
						},new Ext.form.CompositeField({ 
										    fieldLabel: '源端口范围', 
										    items: [ 
										    		
										    		
										        new Ext.form.TextField({ 
													    name: 'my_field', 
													    flex: 1 
													  }),{
															xtype: 'label',
															style:'padding-top: 5px; ', 
															text:'~'
														},new Ext.form.TextField({ 
													    name: 'my_field', 
													    flex: 1 
													  })
										         
										    ] 
						}),{
								xtype : 'textfield',
								fieldLabel : '目的IP',
								id : 'destip1',
								name : 'destip1',
								anchor : '100%'
						},{
								xtype : 'textfield',
								fieldLabel : '掩码',
								id : 'destmask1',
								name : 'destmask1',
								anchor : '100%'
						},new Ext.form.CompositeField({ 
										    fieldLabel: '目的端口范围', 
										    items: [ 
										    		
										    		
										        new Ext.form.TextField({ 
													    name: 'my_field', 
													    flex: 1 
													  }),{
															xtype: 'label',
															style:'padding-top: 5px; ', 
															text:'~'
														},new Ext.form.TextField({ 
													    name: 'my_field', 
													    flex: 1 
													  })
										         
										    ] 
						}),{
								fieldLabel: '协议',
								xtype : 'combo',
								name : 'protocol1',
								frame : true,
								id : 'protocol1',
								store : new Ext.data.ArrayStore({
										fields : ['abbr', 'state'],
										data : states2
									}),
								valueField : 'abbr',
								displayField : 'state',
								typeAhead : true,
								mode : 'local',
								triggerAction : 'all',
								value : '1',
								editable : false,
								anchor: '100%'
						},{
								fieldLabel: '方向',
								xtype : 'combo',
								name : 'path1',
								frame : true,
								id : 'path1',
								store : new Ext.data.ArrayStore({
										fields : ['abbr', 'state'],
										data : states3
									}),
								valueField : 'abbr',
								displayField : 'state',
								typeAhead : true,
								mode : 'local',
								triggerAction : 'all',
								value : '1',
								editable : false,
								anchor: '100%'
						},{
								fieldLabel: '动作',
								xtype : 'combo',
								name : 'action1',
								frame : true,
								id : 'action1',
								store : new Ext.data.ArrayStore({
										fields : ['abbr', 'state'],
										data : states4
									}),
								valueField : 'abbr',
								displayField : 'state',
								typeAhead : true,
								mode : 'local',
								triggerAction : 'all',
								value : '1',
								editable : false,
								anchor: '100%'
						}
	
		]
	};

	var setWindows = new Ext.Window({
				layout : 'border',
				width : 650,
				height : 550,
				title : "添加申请单",
				modal : true,
				resizable : true,
				maximizable : true,
				iconCls : 'firewall',
				items : [set_center],
				plain : true
				
			});
	setWindows.addButton({
				text : "确定",
				handler : function() {
					setWindows.close();
				}
			});
	setWindows.addButton({
				text : '取 消',
				handler : function() {
					setWindows.close();
				}
			});
	setWindows.show();
}

